home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 25 / AACD 25.iso / AACD / Sound / MSE / docs / MSE-Compiler.hints < prev    next >
Encoding:
Text File  |  1997-05-21  |  12.5 KB  |  452 lines

  1. This Hint documentation assumes that you already have read the MSE-Compiler
  2. documentation and that you are familiar with the definition language.
  3.  
  4. Note that in the following definition examples, not all required parameters
  5. are included.  Only the parameters necessary to clarify are given.
  6. Assumptions are also made that reference definitions have been defined.
  7.  
  8. See the MSE-Compiler documentation for required parameters and proper
  9. referencing requirements.
  10.  
  11. ----------------------------------------------------------------------------
  12.  
  13. Shown as:
  14.  
  15.     $F0, $43, $1n, $34, $01, T2, $00, N2, $00, V2, $F7
  16.  
  17.     Where:    n  : Device Number
  18.                     T2 : voice channel number
  19.                     V2 : parameter value
  20.                     N2 : parameter number
  21.  
  22. Discussion:
  23.  
  24.     T2, V2 and N2 will be set by gadget definitions.  Here, these are
  25.   initialized as 'Byte' (equivalent to 0).
  26.  
  27.     Normally, the Device Number, or MIDI Channel as it is commonly called,
  28.     will be defined within the 'Define Device' structure.  It could be forced
  29.     here, but it can be changed within MSE so the CHANNEL variable should be
  30.     used.  If you forced it here, changing the MIDI Channel within MSE would
  31.     have no effect.  Remember that CHANNEL is stored in the lower 4 bits, so
  32.     $1n can be intialized as $10.
  33.  
  34.     Because the MIDI Channel can be changed within MSE, the 'Midi' structure
  35.   is used here to cause the MIDI Channel to be stored in the MIDI message
  36.     each time it is sent out.  It could also be included in gadget
  37.     definitions, but it would have to be defined for every gadget that used
  38.     this message.  Putting it here is more sensible and makes the module
  39.     smaller too.
  40.  
  41. Defined as:
  42.  
  43.     Define Midi "M1" (
  44.         Data (
  45.             $F0
  46.             $43
  47.             $10 'Channel $1n
  48.             $34
  49.             $01
  50.             Byte 'T2
  51.             $00
  52.             Byte 'N2
  53.             $00
  54.             Byte 'V2
  55.             $F7
  56.         )
  57.         Midi (
  58.             2 CHANNEL
  59.         )
  60.     )
  61.  
  62. ----------------------------------------------------------------------------
  63.  
  64. Shown as:
  65.  
  66.     0    1    2    3    4    5   6    7   8    9   10  : <offset>
  67.  
  68.     $F0, $43, $1n, $34, $01, T2, $00, N2, $00, V2, $F7
  69.  
  70.     Where:    V2: -64 to +63 (o/b)
  71.  
  72. Discussion:
  73.  
  74.     Usually, when a parameter has a value range with negative numbers, a
  75.   <modifier> definition must be included.  Negative values usually require
  76.     some kind of conversion.  In this case, (o/b) indicates that 'Offset
  77.     Binary' encoding is used.
  78.  
  79. Defined as:
  80.  
  81.     Gadget "G1" (
  82.         Type Slider (
  83.             Range -64 63
  84.         )
  85.         Midi "M1" (
  86.             Data (
  87.                 9 VALUE Offset 64 Byte 'V2 with Offset Binary encoding
  88.             )
  89.         )
  90.     )
  91.  
  92. ----------------------------------------------------------------------------
  93.  
  94. Shown as:
  95.  
  96.     0    1    2    3    4    5   6    7   8    9   10  : <offset>
  97.  
  98.     $F0, $43, $1n, $34, $01, T2, $00, N2, $00, V2, $F7
  99.  
  100.     Where:    V2: voice, -31 to +31 (o/b)
  101.  
  102. Discussion:
  103.  
  104.     This examples differs from the previous in that the V2 value can also
  105.     have a value for 'voice'.  In this case, 'voice' takes the value of 0,
  106.     -31 = 1, -30 = 2, etc.
  107.  
  108.     There are a couple ways to define this example.  The first would be
  109.     to use a method similar to the previous, adjusting the Range value (-31
  110.     becomes -32) to account for the additional 'voice' value.
  111.  
  112.         Gadget "G1" (
  113.             Type Slider (
  114.                 Range -32 31
  115.             )
  116.             Midi "M1" (
  117.                 Data (
  118.                     9 VALUE Offset 32 Byte 'V2 with Offset Binary encoding
  119.                 )
  120.             )
  121.         )
  122.  
  123.     This would work, but would mean that you had to remember that the value
  124.     of -32 really meant 'voice'.  There is a better way to do this using
  125.     a 'Link' option.  This is a little more work, but is much better.
  126.  
  127.     A 'Text' link type is used to accommodate the 'voice' option.  This
  128.     forces the remaining values to also be text, so each has to be defined.
  129.  
  130.     Note that the slider 'Range' is adjusted to start at 0, since this
  131.     is required by links.  This also means that the 'DataValues' option is
  132.     not required within the link definition because the values will already
  133.     be correct.
  134.  
  135.     Although this method is a bit awkward, keep in mind that links can be
  136.     shared among multiple gadgets.  So, if several parameters use these same
  137.     values, the link need only be defined once.  A new link type may be added
  138.     later to better accommodate this.
  139.  
  140. Defined as:
  141.  
  142.     Define Link "L1" (
  143.         Type Texts (
  144.             Data (
  145.                 "Voice" "-31" "-30" "-29" "-28" "-27" "-26" "-25" "-24" "-23" "-22"
  146.                 "-21" "-20" "-19" "-18" "-17" "-16" "-15" "-14" "-13" "-12" "-11"
  147.                 "-10" "-9" "-8" "-7" "-6" "-5" "-4" "-3" "-2" "-1" "0"
  148.                 "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15"
  149.                 "16" "17" "18" "19" "20" "21" "22" "23" "24" "25" "26" "27" "28"
  150.                 "29" "30" "31"
  151.             )
  152.         )
  153.     )
  154.  
  155.     Gadget "G1" (
  156.         Type Slider (
  157.             Range 0 63
  158.             Link "L1"
  159.         )
  160.         Midi "M1" (
  161.             Data (
  162.                 9 VALUE Byte 'V2
  163.             )
  164.         )
  165.     )
  166.  
  167. ----------------------------------------------------------------------------
  168.  
  169. Shown as:
  170.  
  171.     0    1    2    3    4    5   6    7   8    9   10  : <offset>
  172.  
  173.     $F0, $43, $1n, $34, $03, T2, $00, N2, $00, V2, $F7
  174.  
  175.     Where:    V2: -7 to +7 (s/m)
  176.  
  177. Discussion:
  178.  
  179.     This is another example of encoding ranges with negative values.  In this
  180.     case, (s/m) indicates that 'Signed Magnitude' encoding is used.
  181.  
  182.     Note that the maximum value +7 requires 3 bits (0-2), so bit 3 is used to
  183.     hold the magnitude.
  184.  
  185. Defined as:
  186.  
  187.     Gadget "G1" (
  188.         Type Slider (
  189.             Range -7 7
  190.         )
  191.         Midi "M1" (
  192.             Data (
  193.                 9 VALUE Magnitude 3 Byte 'V2 with Signed Magnitude encoding.
  194.             )
  195.         )
  196.     )
  197.  
  198. ----------------------------------------------------------------------------
  199.  
  200. Shown as:
  201.  
  202.     0    1    2    3    4    5   6    7   8   9   10  : <offset>
  203.  
  204.     $F0, $43, $1n, $34, $04, T2, $00, N2, V1, V2, $F7
  205.  
  206.     Where:    V1/V2: 0 to 255 (V1;MSB  V2;LS7bits)
  207.  
  208. Discussion:
  209.  
  210.     Here, within XBits 'a' represents the MSB (bit 7) and 'b' the lower 7
  211.     bits (0-6).
  212.  
  213.     Remember that when a value is stored as more than one byte, the <offset>
  214.     value for 'Data' within a 'Midi' definition is the first byte.
  215.  
  216. Define as:
  217.  
  218.     Midi "M1" (
  219.         Data (
  220.             8 VALUE XBits abbbbbbb 'V1/V2
  221.         )
  222.     )
  223.  
  224. ----------------------------------------------------------------------------
  225.  
  226. Shown as:
  227.  
  228.     0    1    2    3    4    5   6    7   8    9   10  : <offset>
  229.  
  230.     $F0, $43, $1n, $34, $05, T2, $00, N2, $00, V2, $F7
  231.  
  232.     Where:    V2: off/on
  233.  
  234. Discussion:
  235.  
  236.     Here, 'off' has a value of 0 and 'on' is 1.  A cycle gadget, or a slider
  237.     gadget with a link can be used.  If many parameters use the same values,
  238.     the second method is the better choice.
  239.  
  240. Define as:
  241.  
  242.     Gadget "G1" (
  243.         Type Cycle (
  244.             Data (
  245.                 "OFF"
  246.                 "ON"
  247.             )
  248.         )
  249.         Midi "M1" (
  250.             Data (
  251.                 9 VALUE Byte 'V2
  252.             )
  253.         )
  254.     )
  255.  
  256.     - - OR - -
  257.  
  258.     Define Link "L1" (
  259.         Type Texts (
  260.             Data (
  261.                 "OFF"
  262.                 "ON"
  263.             )
  264.         )
  265.     )
  266.  
  267.     Gadget "G1" (
  268.         Type Slider (
  269.             Range 0 1
  270.             Link "L1"
  271.         )
  272.         Midi "M1" (
  273.             Data (
  274.                 9 VALUE Byte 'V2
  275.             )
  276.         )
  277.     )
  278.  
  279. ----------------------------------------------------------------------------
  280.  
  281. Shown as:
  282.  
  283.     0    1    2    3    4   5   6    7   8   9   10  : <offset>
  284.  
  285.     $F0, $43, $1n, $34, T1, T2, $00, N2, V1, V2, $F7
  286.  
  287.     Where:    V2: b1,0     ;0 to 3    Oscilator output destination
  288.                             b3,2     ;0 to 2    Out_Accumulator input 0 source
  289.                             b4       ;0 to 1    Out_Accumulator input 1 source
  290.  
  291. Discussion:
  292.  
  293.     Sometimes, several parameters share the same byte for storing their
  294.     values, each using one or more bits.  In this case, there are 3
  295.     parameters sharing V2: Parameter 1 uses the lower 2 bits (0-1), parameter
  296.     2 uses the next 2 bits (2-3) and parameter 3 uses the next bit (4).
  297.  
  298.     ************************************************************************
  299.     NOTE: The current method to handle this situation has a problem, related
  300.     to loading patches.  A new feature will be added to MSE in the future
  301.     that will solve this problem.  Until then, there are three possible
  302.     'solutions'.  The first method avoids the problem.  The second, also
  303.     avoids the problem but requires that patch loading not be enabled.  The
  304.     third allows the problem to exist, but requires the user to remember
  305.     certain things about changing some parameters.  Each has it advantages
  306.     and disadvantages.
  307.  
  308.     1) Only define full patch definitions, ignoring individual parameter
  309.          messages.  This will allow all parameters to update properly when
  310.          loading patches.  The disadvantage of this is that every value change
  311.          will send the full patch message.  With large patch messages this will
  312.          generate a large amount of data transmission.  In most cases, the
  313.          device will be unable to keep up with all the data.  To solve this
  314.          overflow problem, set the 'Updates Final' option in 'Define Device' or
  315.          force manual patch sending by not including the 'Send' option of
  316.          'Midi' and using the menu 'Project/Send' to send the patch any time
  317.          during patch editing.
  318.  
  319.     2) Only define individual parameter messages, ignoring full patch
  320.          definitions.  This will allow all parameters to update properly, but
  321.          has the disadvantage of not being able to save and/or load patches.
  322.  
  323.     3) Define both individual parameter and full patch messages, but remember
  324.          that if you adjust one of a group of shared parameters, you must
  325.          re-adjust the others in the group as well.  For example, if three
  326.          shared parameters are defined with both message types and are
  327.          initially set as follows:
  328.  
  329.                 P1 = 10, P2 = 5, P3 = 7
  330.  
  331.          and then you load a patch with those parameters set as follows:
  332.  
  333.                 P1 = 3, P2 = 1, P3 = 10
  334.  
  335.          At this point, the patch message is correct, but the individual
  336.          parameter message is wrong.  So far, this is okay because only the
  337.          patch message has been sent.  But, when you manually edit P2 to be set
  338.          at 6.  MSE will send the following incorrect individual parameter
  339.          message values:
  340.  
  341.                 P1 = 10, P2 = 6, P3 = 7
  342.  
  343.          However, the gadgets will still correctly display as:
  344.  
  345.                 P1 = 3, P2 = 6, P3 = 10
  346.  
  347.          So, to solve the error, you would then have to remember to manually
  348.          re-set P1 and P3.  After doing so, all three parameters would have been
  349.          updated in the parameter message.  Everything would then work, until
  350.          you loaded another patch.
  351.  
  352.          Note that, as long as you do not adjust any of the shared parameters,
  353.          loading patches will work fine.
  354.     ************************************************************************
  355.  
  356.     Regardless of which method you use, the following still applies:
  357.  
  358.     Parameters that share values require their own 'Define Midi' definition.
  359.     This is so that MSE can send all the shared parameters even when only one
  360.     value is changing.  This means that MSE does not have to remember which
  361.     gadgets represent which bits, nor does it have to determine the other
  362.     parameter values when it sends the message.
  363.  
  364.     Unlike parameters that do not share, the initial value for these
  365.     parameters must be set within the 'Define Midi' definition.
  366.  
  367.  
  368. Define as:
  369.  
  370.     Define Midi "M1" (
  371.         Data (
  372.             $F0
  373.             $43
  374.             $10 'Channel $1n
  375.             $34
  376.             Byte 'T1
  377.             Byte 'T2
  378.             $00
  379.             Byte 'N2
  380.             Byte 'V1
  381.             %11011 'V2 See defaults below: %1, %10, %11
  382.             $F7
  383.         )
  384.     )
  385.  
  386.     Gadget "P1" (
  387.         Type Slider (
  388.             Range 0 3
  389.             Default 3 '%11
  390.         )
  391.         Midi "M1" (
  392.             Data (
  393.                 9 VALUE Bits 0-1
  394.             )
  395.         )
  396.     )
  397.  
  398.     Gadget "P2" (
  399.         Type Slider (
  400.             Range 0 2
  401.             Default 2 '%10
  402.         )
  403.         Midi "M1" (
  404.             Data (
  405.                 9 VALUE Bits 2-3
  406.             )
  407.         )
  408.     )
  409.  
  410.     Gadget "P3" (
  411.         Type Slider (
  412.             Range 0 1
  413.             Default 1 '%1
  414.         )
  415.         Midi "M1" (
  416.             Data (
  417.                 9 VALUE Bit 4
  418.             )
  419.         )
  420.     )
  421.  
  422. ----------------------------------------------------------------------------
  423.  
  424.  
  425. Other Helpful hints:
  426.  
  427. Some devices do not have textual descriptions of parameters on the display
  428. screens, but do have in the manuals.  Say Device X allows you to
  429. set Parameter #6 to a value of 1, 2 or 3.  Well, that's easy.  Make a
  430. slider gadget with a range of 1 to 3 and text that says "Parameter #6".
  431. Well, that works, but MSE lets you make it even easier to understand.
  432. The manual for Device X says that Parameter #6 is LFO Waveform, and that 1
  433. is SINE, 2 is TRIANGLE and 3 is PULSE... well that makes a lot more sense.
  434. Remember that MSE lets you use any representation of parameter values that
  435. you want.  So, in MSE we could make a cycle gadget with the text "LFO
  436. Waveform" above it with values of "SINE", "TRIANGLE" and "PULSE".  Even
  437. though we see text information in MSE, we can tell it to send #6, 1, 2 and
  438. 3 to the device.  Device X will never know what happened, which is good,
  439. because it might get jealous and refuse to operate properly if it did.
  440.  
  441. Say Device X also has a selection of 150 different waveforms, but it
  442. numbers them from 1 to 150.  It's tough to remember which is which...
  443. wouldn't it be nice if they all had names that meant something to you!
  444. So, go ahead and give them names, call them whatever you want.  MSE can do
  445. that too!  You could do it with a cycle gadget, but a slider gadget with a
  446. Text Type Link would be better.  Try it.
  447.  
  448. Just because Device X refers to a parameter as ALGSRC0 doesn't mean you
  449. can't call it by something english (or any language for that matter)...
  450. 'Oscillator Input 0 Source' makes more sense to us people types.  Doesn't
  451. it?
  452.